<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<script language="JavaScript" type="text/javascript">
						
					    function kiemtra(diem)
						{
						 	var tong=0,i;
							for (i=1; i<= diem; i ++)
							{
								tong= parseFloat(tong)+parseFloat(document.getElementById("alphai"+i).value)
								//alert(i);
							}
							return tong
						}
</script>

<%
				  
 rs.open "select * from sanpham where masanpham ="&Session("ma_sp")& " and status=1 ",conn
 
%>
<body>
<label>
    Nhập hệ số alpha H của sản phẩm:</label>
<label>
    <%=rs("tensanpham")%>  
</label>
<%rs.close()%>
<form action="DanhSachPhieuDiem.asp" method="post" name="nhantoconnguoi" id="nhantoconnguoi"
    onsubmit="MM_validateForm('Tổng alpha H','','RinRange1:1');return document.MM_returnValue">
    <table width="100%" border="0">
        <tr>
            <td>
                &nbsp;</td>
            <td>
                Hệ số anpha H
            </td>
        </tr>
        <% rs.open "select * from nhantoconnguoi where masanpham = "& Session("ma_sp"),conn%>
        <% dem=1
					  	while not rs.eof 
        %>
        <tr>
            <td >
                <%=rs("tennhantoconnguoi")%>                
                <input name="machitiettt<%=dem%>" type="hidden" id="machitiettt<%=dem%>" value="<%=rs("manhantoconnguoi")%>" /></td>
            <td>
                <input name="alphai<%=dem%>" type="text" id="alphai<%=dem%>" value="<%=rs("alphah")%>"
                    size="3" /></td>
        </tr>
        <%dem = dem +1%>
        <%rs.movenext()%>
        <%wend %>
        <%rs.close()%>
        <tr>
            <td>
                <div align="right">
                    <input name="Submit" type="submit" onmouseover="document.getElementById('Tổng alpha H').value=kiemtra(<%=dem-1%>)"
                        value="  Nhập  " />
                </div>
            </td>
            <td>
                <input name="Tổng alpha H" type="text" id="Tổng alpha H" size="3" readonly="readonly" />
                <input name="demso" type="hidden" id="demso" value="<%=dem-1%>" readonly="readonly" /></td>
        </tr>
    </table>
</form>
</body>
</html>